package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.net.domain.ElementBusiSrtpAlarmoamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpAlarmoamMapper;
import com.ruoyi.net.domain.ElementBusiSrtpAlarmoam;
import com.ruoyi.net.service.IElementBusiSrtpAlarmoamService;

/**
 * 网元-业务-srtp-故障检测oamService业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpAlarmoamServiceImpl implements IElementBusiSrtpAlarmoamService 
{
    @Autowired
    private ElementBusiSrtpAlarmoamMapper elementBusiSrtpAlarmoamMapper;

    /**
     * 查询网元-业务-srtp-故障检测oam
     * 
     * @param id 网元-业务-srtp-故障检测oam主键
     * @return 网元-业务-srtp-故障检测oam
     */
    @Override
    public ElementBusiSrtpAlarmoam selectElementBusiSrtpAlarmoamById(String id)
    {
        return elementBusiSrtpAlarmoamMapper.selectElementBusiSrtpAlarmoamById(id);
    }

    /**
     * 查询网元-业务-srtp-故障检测oam列表
     * 
     * @param elementBusiSrtpAlarmoam 网元-业务-srtp-故障检测oam
     * @return 网元-业务-srtp-故障检测oam
     */
    @Override
    public List<ElementBusiSrtpAlarmoamVo> selectElementBusiSrtpAlarmoamList(ElementBusiSrtpAlarmoam elementBusiSrtpAlarmoam)
    {
        return elementBusiSrtpAlarmoamMapper.selectElementBusiSrtpAlarmoamList(elementBusiSrtpAlarmoam);
    }

    /**
     * 新增网元-业务-srtp-故障检测oam
     * 
     * @param elementBusiSrtpAlarmoam 网元-业务-srtp-故障检测oam
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpAlarmoam(ElementBusiSrtpAlarmoam elementBusiSrtpAlarmoam)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpAlarmoam.getId())) {
            elementBusiSrtpAlarmoam.setId(uuid);
        }
        elementBusiSrtpAlarmoam.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpAlarmoam.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpAlarmoam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpAlarmoam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpAlarmoamMapper.insertElementBusiSrtpAlarmoam(elementBusiSrtpAlarmoam);
    }

    /**
     * 修改网元-业务-srtp-故障检测oam
     * 
     * @param elementBusiSrtpAlarmoam 网元-业务-srtp-故障检测oam
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpAlarmoam(ElementBusiSrtpAlarmoam elementBusiSrtpAlarmoam)
    {
        elementBusiSrtpAlarmoam.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpAlarmoam.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpAlarmoamMapper.updateElementBusiSrtpAlarmoam(elementBusiSrtpAlarmoam);
    }

    /**
     * 批量删除网元-业务-srtp-故障检测oam
     * 
     * @param ids 需要删除的网元-业务-srtp-故障检测oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpAlarmoamByIds(String[] ids)
    {
        return elementBusiSrtpAlarmoamMapper.deleteElementBusiSrtpAlarmoamByIds(ids);
    }

    /**
     * 删除网元-业务-srtp-故障检测oam信息
     * 
     * @param id 网元-业务-srtp-故障检测oam主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpAlarmoamById(String id)
    {
        return elementBusiSrtpAlarmoamMapper.deleteElementBusiSrtpAlarmoamById(id);
    }
}
